package com.ruoyi.system.service.shopping.impl;

import com.ruoyi.system.domain.shopping.Carousel;
import com.ruoyi.system.mapper.shopping.CarouselMapper;
import com.ruoyi.system.service.shopping.CarouselService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CarouselServiceImpl implements CarouselService {
    @Autowired
    private CarouselMapper carouselMapper;
    @Override
    public List<Carousel> list() {
        List<Carousel> carousels = carouselMapper.selectList();
        return carousels;
    }

    @Override
    public Boolean add(Carousel carousel) {
        return carouselMapper.insert(carousel)>0;
    }

    @Override
    public Carousel selectById(Integer carouselId) {
        return carouselMapper.selectById(carouselId);
    }

    @Override
    public Boolean update(Carousel carousel) {
        return carouselMapper.update(carousel)>0;
    }

    @Override
    public Boolean deleteByIds(Integer[] carouselIds) {
        return carouselMapper.deleteByIds(carouselIds)>0;
    }
}
